#ifndef SLEEWORD_H
#define SLEEWORD_H

#include <ActiveQt/QAxBase>
#include <ActiveQt/QAxObject>
#include "sleeofficeglobal.h"
#include <QString>
#include <QObject>
#include <QHash>
#include <QDir>
#include "sleeqaxptr.h"
#include "sleeworddoc.h"


class SLEEOFFICESHARED_EXPORT SleeWord
{
    SleeQAxPtr  m_word;
    SleeQAxPtr  m_documents;
    QHash<quint32, SleeWordDoc * > mqh_docs;
    bool mb_word_ok;
    quint32 m_last_id;
    quint32 gen_id();
    bool is_id_ok(quint32 id);

public:
    SleeWord();

    void run_word();
    void quit_word();
    void set_visible(bool state);
    SleeWordDoc * open_document(QString file_pathname);
    SleeWordDoc * create_new(QString template_file_pathname = QString());
    void close_document(SleeWordDoc **pp_doc);
    QString generate_documentation(const QDir &dir);
};

#endif // SLEEWORD_H
